# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=torpy
pkgver=60.ebf000c
pkgrel=7
pkgdesc='Pure python Tor client implementation.'
groups=('blackarch' 'blackarch-networking')
arch=('any')
url='https://github.com/torpyorg/torpy'
license=('Apache')
depends=('python' 'python-cffi' 'python-cryptography' 'python-pycparser'
         'python-requests')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/torpyorg/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/${pkgname}_cli" "$pkgdir/usr/bin/$pkgname-cli"
  mv "$pkgdir/usr/bin/${pkgname}_socks" "$pkgdir/usr/bin/$pkgname-socks"
}

